﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NormReference.Models
{
    public class NormReferenceResult : IComparable<NormReferenceResult>
    {
        public int id { get; set; }
        public int comparisonGroupID { get; set; }
        public string questionNumber { get; set; }
        public string nsize { get; set; }
        public decimal probability { get; set; }
        public decimal value { get; set; }

        public override string ToString()
        {
            return "Norm Reference Result: ID:" + id + " Comparison Group ID: " + comparisonGroupID +
                " Question Number: " + questionNumber + " NSize: " + nsize + " Probability: " +
                probability + " Value: " + value;
        }

        public int CompareTo(NormReferenceResult otherResult)
        {
            int result;

            if (value > otherResult.value)
            {
                result = 1;
            }
            else if (value < otherResult.value)
            {
                result = -1;
            }

            else 
            {
                result = 0;
            }

            return result;
        }

    }
}